﻿<?php 
//error_reporting(E_ERROR|E_PARSE);
header("Content-Type:text/html; charset=utf-8");
session_start();
if($_SESSION["islogin"]!=='igiveyouthepower'){
echo "<script language=JavaScript>\r\n";
echo "alert('请先登录!');\r\n";
echo "location.href='../index.php'\r\n";
echo "</script>";
}else{
require_once('../config.php');
?>
<?php
$conn = mysqli_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname);
$action=$_GET["action"];
$id=intval($_GET["id"]);
if($action=='suoding'){
$sql = "update ph_admin set status='yes' where ID='".$id."'";
mysqli_query($conn,$sql);
echo "<script language=JavaScript>\r\n";
echo "location.href='list.php'\r\n";
echo "</script>";
}
if($action=='jiesuo'){
$sql = "update ph_admin set status='no' where ID='".$id."'";
mysqli_query($conn,$sql);
echo "<script language=JavaScript>\r\n";
echo "location.href='list.php'\r\n";
echo "</script>";
}

?>
<?php }?>